﻿<dialogs:DialogWindow x:Class="Mnk.TBox.Core.PluginsShared.LoadTesting.Components.FormLoadTesting"
             xmlns:loc="clr-namespace:Mnk.TBox.Core.PluginsShared.Code.Localization"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dialogs="clr-namespace:Mnk.Library.WpfControls.Dialogs;assembly=Mnk.Library.WPFControls"
                      xmlns:components="clr-namespace:Mnk.Library.WpfControls.Components;assembly=Mnk.Library.WPFControls"
                      xmlns:Units="clr-namespace:Mnk.Library.WpfControls.Components.Units;assembly=Mnk.Library.WPFControls"
                      xmlns:captioned1="clr-namespace:Mnk.Library.WpfControls.Components.Captioned;assembly=Mnk.Library.WPFControls"
                      xmlns:loadTesting="clr-namespace:Mnk.TBox.Core.PluginsShared.LoadTesting"
                      mc:Ignorable="d" 
             Width="480" Height="480"
             MinWidth="480" MinHeight="380"
             ShowInTaskbar="True" >
    <DockPanel>
        <WrapPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Margin="10">
            <Button Name="btnCopy" IsEnabled="False" Content="{loc:Tr CopyResultsToClipboard}" Margin="5" Click="BtnCopyClick" />
            <Button Name="btnStartStop" Content="{loc:Tr Start}" Margin="5" Click="BtnStartClick" IsDefault="True"/>
            <Button Content="{loc:Tr Cancel}"  Margin="5" IsCancel="True" Click="CancelClick"/>
        </WrapPanel>
        <TabControl Name="Tabs">
            <TabItem Header="{loc:Tr Settings}" >
                <DockPanel>
                    <components:PanelToICheckable x:Name="Panel" DockPanel.Dock="Bottom" />
                    <components:CheckableListBox Name="Operations" ItemsSource="{Binding Ops, Mode=TwoWay}">
                        <components:CheckableListBox.ItemTemplate>
                            <DataTemplate DataType="{x:Type loadTesting:IOperation}">
                                <DockPanel Margin="0,5">
                                    <DockPanel DockPanel.Dock="Right">
                                        <captioned1:CaptionedNumericUpDown Value="{Binding Delay}" Caption="{loc:Tr RequestsDelay}" Minimum="0" Margin="0" Width="100"/>
                                        <captioned1:CaptionedNumericUpDown Value="{Binding Timeout}" Caption="{loc:Tr Timeout}" Minimum="0" Margin="0" Width="100"/>
                                        <captioned1:CaptionedNumericUpDown Value="{Binding Threads}" Caption="{loc:Tr Threads}" Minimum="1" Maximum="4096" Margin="0" Width="100"/>
                                    </DockPanel>
                                    <components:ExtCheckBox IsChecked="{Binding IsChecked}" VerticalAlignment="Center" Padding="5,0" ValueChanged="CheckBoxChecked" DockPanel.Dock="Left"/>
                                    <TextBlock Text="{Binding Key}" Padding="0" FontWeight="Bold"/>
                                </DockPanel>
                            </DataTemplate>
                        </components:CheckableListBox.ItemTemplate>
                    </components:CheckableListBox>
                </DockPanel>
            </TabItem>
            <TabItem Header="{loc:Tr Graphics}">
                <DockPanel>
                    <ComboBox Name="Graphics" IsEditable="False" DockPanel.Dock="Top" Margin="5" SelectionChanged="OnSelectedGraphicChanged"/>
                    <Units:GraphUnit x:Name="Graph" OxCaption="{loc:Tr TestTime}" OyCaption="{loc:Tr ResponseTime}" DockPanel.Dock="Bottom" />
                </DockPanel>
            </TabItem>
            <TabItem Header="{loc:Tr Statistic}">
                <DockPanel>
                    <ComboBox Name="Statistic" IsEditable="False" DockPanel.Dock="Top" Margin="5" SelectionChanged="OnSelectedStatisticChanged"/>
                    <TextBox Name="Results" IsReadOnly="True"/>
                </DockPanel>
            </TabItem>
        </TabControl>
    </DockPanel>
</dialogs:DialogWindow>
